<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
    <head>
        <meta charset="utf-8">
        <title>菜单添加--后台管理</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="format-detection" content="telephone=no">
        <link rel="stylesheet" th:href="@{/static/layui/css/layui.css}" media="all" />
        <link rel="stylesheet" th:href="@{/static/colorpicker/colpick.css}" media="all" />
        <style type="text/css">
            .layui-form-item .layui-inline{ width:33.333%; float:left; margin-right:0; }
            @media(max-width:1240px){
                .layui-form-item .layui-inline{ width:100%; float:none; }
            }
            .layui-form-item .role-box {
                position: relative;
            }
            .layui-form-item .role-box .jq-role-inline {
                height: 100%;
                overflow: auto;
            }
            .color-box {
                float:left;
                width:30px;
                height:30px;
                margin:5px;
                border: 1px solid white;
            }
        </style>
    </head>
    <body class="childrenBody">
        <form class="layui-form" style="width:80%;">
            <div class="layui-form-item" th:if="${parentMenu} != null">
                <label class="layui-form-label">父菜单名称</label>
                <div class="layui-input-block">
                    <select name="parentId" class="layui-input">
                        <option th:value="${parentMenu.id}"> <span th:text="${parentMenu.name}"></span></option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">菜单名称</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" name="name" lay-verify="required" placeholder="请输入菜单名称">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">菜单背景色</label>
                <div class="layui-input-block">
                    <input type="hidden" class="layui-input" name="bgColor" >
                    <div class="color-box"></div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">菜单地址</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" name="href"  placeholder="请输入菜单地址">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">菜单权限</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" name="permission"  placeholder="菜单权限">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">菜单图标</label>
                <div class="layui-input-block">
                    <input type="hidden" class="layui-input" name="icon" id="iconValue"  placeholder="请选择菜单图标">
                    <div class="layui-input-inline" style="width: 100px;">
                        <i class="layui-icon" id="realIcon" style="display: none;font-size: 50px"></i>
                    </div>
                    <div class="layui-input-inline" style="width: 100px;">
                        <a class="layui-btn layui-btn-normal" id="selectIcon">我来选择一个图标</a>
                    </div>
                </div>
            </div>
            <shiro:hasPermission name="sys:menu:add">
            <div class="layui-form-item">
                <label class="layui-form-label">左侧菜单栏是否显示</label>
                <div class="layui-input-block">
                    <input type="checkbox" name="isShow" lay-skin="switch"    lay-text="是|否" checked>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit="" lay-filter="addMenu">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
            </shiro:hasPermission>
        </form>
        <script type="text/javascript" th:src="@{/static/layui/layui.js}"></script>
        <script type="text/javascript" th:src="@{/static/colorpicker/colpick.js}"></script>
        <script type="text/javascript" th:src="@{/static/admin/js/menu/menuAdd.js}"></script>
    </body>
</html>